package com.yunhai.system.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.yunhai.system.mapper.FileMapper;
import com.yunhai.system.domain.File;
import com.yunhai.system.service.IFileService;

import java.util.List;
import java.util.Map;

/**
 * 附件管理Service业务层处理
 *
 * @author jxj
 * @date 2021-01-21
 */
@Service
public class FileServiceImpl extends ServiceImpl<FileMapper, File> implements IFileService {

    @Override
    public List<File> queryList(File file) {
        LambdaQueryWrapper<File> lqw = Wrappers.lambdaQuery();
        if (StringUtils.isNotBlank(file.getFileName())) {
            lqw.like(File::getFileName, file.getFileName());
        }
        lqw.orderByDesc(File::getCreateTime);
        return this.list(lqw);
    }
}
